package com.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableAsync
@EnableTransactionManagement
@SpringBootApplication
@SuppressWarnings("all")
//@ServletComponentScan
public class SpringbootListenerApplication {
    //@Bean
    //public ServletListenerRegistrationBean registrationBean() {
    //    ServletListenerRegistrationBean registrationBean = new ServletListenerRegistrationBean();
    //    registrationBean.setListener(new IndexListener());
    //    return registrationBean;
    //}
    public static void main(String[] args) {
        SpringApplication.run(SpringbootListenerApplication.class, args);
        //SpringApplication springApplication = new SpringApplication(SpringbootListenerApplication.class);
        ////注册事件监听器MyListener
        //springApplication.addListeners(new MyListener());
        //ConfigurableApplicationContext context = springApplication.run(args);
        ////发布事件
        ////context.publishEvent(new MyEvent(new Object()));
    }
}
